// CEDebugCF.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "CEDebugCFNative.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
        case DLL_PROCESS_ATTACH:
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
            break;
    }
    return TRUE;
}

///-------------------------------------------------------------------------------------------------
/// <summary>	Calls OS debug message macro: RETAILMSG </summary>
/// 
/// <remarks>	This macro is present in Retail, Debug and Checked builds; it does nothing in Ship builds </remarks>
///
/// <param name="expression">	Any boolean expression that when evaluated if true, the formatted message appears in Output-Debug on dev system </param>
/// <param name="message">   	The formatted message. </param>
///-------------------------------------------------------------------------------------------------

CEDebugCF_API void   RetailMsg( BOOL expression, LPWSTR message)
{
	RETAILMSG(expression, (_T("%s"),message));
}

///-------------------------------------------------------------------------------------------------
/// <summary>	Calls OS debug message macro: DEBUGMSG </summary>
/// 
/// <remarks>	This macro is only present in Debug and Checked builds; it does nothing in Retail and Ship builds </remarks>
/// 
/// <param name="expression">	Any boolean expression that when evaluated if true, the formatted message appears in Output-Debug on dev ssystem </param>
/// <param name="message">   	The formatted message. </param>
///--------------------------------------------------------------------------------------------------

CEDebugCF_API void	 DebugMsg( BOOL expression, LPWSTR message)
{
	DEBUGMSG(expression, (_T("%s"),message));
}

///-------------------------------------------------------------------------------------------------
/// <summary>	This macro is very similar to RETAILMSG ,except that the ERRORMSG macro prefixes the message with "ERROR", and gives the file name and line number of the error.. </summary>
/// 
/// <remarks>	This macro is present in Retail, Debug and Checked builds; it does nothing in Ship builds </remarks>
/// 
/// <param name="expression">	Any boolean expression that when evaluated if true, </param>
/// <param name="message">   	The message. </param>
///-------------------------------------------------------------------------------------------------

CEDebugCF_API void  ErrorMsg( BOOL expression, LPWSTR message)
{
	ERRORMSG(expression, (_T("%s"),message));
}

///-------------------------------------------------------------------------------------------------
/// <summary>	Asserts. </summary>
///
/// <remarks>	This macro is only present in Debug and Checked builds; it does nothing on Retail and Ship builds </remarks>
///
/// <param name="expression">	Any boolean expression that when evaluated if true, </param>
///-------------------------------------------------------------------------------------------------

CEDebugCF_API void  Assert( BOOL expression)
{
	ASSERT(expression);
}

///-------------------------------------------------------------------------------------------------
/// <summary>	Assert message. </summary>
///
/// <remarks>	This macro is only present in Debug and Checked builds; it does nothing on Retail and Ship builds </remarks>
///
/// <param name="message">   	The message. </param>
/// <param name="expression">	Any boolean expression that when evaluated if true, </param>
///-------------------------------------------------------------------------------------------------

CEDebugCF_API void  AssertMsg(  LPWSTR message, BOOL expression)
{
	ASSERTMSG((_T("%s"),message),expression);
}

///-------------------------------------------------------------------------------------------------
/// <summary>	This macro conditionally outputs WORD values to the LED. </summary>
/// <summary>	Requires OEM implementation of LEDs</summary>
///
/// <remarks>	Calls RETAILLED. </remarks>
/// <remarks>	This macro is present in Retail, Debug and Checked builds; it does nothing in Ship builds </remarks>
///
/// <param name="expression">	Any boolean expression that when evaluated if true, the LED pattern is chamged. </param>
/// <param name="Index">	 	Index of LED array (each up to 32 bits). </param>
/// <param name="dwPattern"> 	Specifies the bit pattern. </param>
///-------------------------------------------------------------------------------------------------

CEDebugCF_API void  RetailLED( BOOL expression, WORD Index, DWORD dwPattern)
{
	RETAILLED(expression, (Index,dwPattern));
}

///-------------------------------------------------------------------------------------------------
/// <summary>	This macro conditionally outputs WORD values to the debug LEDs. </summary>
/// <summary>	Requires OEM implementation of LEDs</summary>
/// <summary>	See C:\WINCE800\public\common\oak\drivers\nleddrvr</summary>
/// <summary>	Note NLEDs has been removed from the Catalog in WEC 2013 </summary>
///
/// <remarks>	Calls DEBUGLED. </remarks>
/// <remarks>	This macros is only present in Debug and Checked builds; it does nothing on Retail and Ship builds </remarks>
///
/// <param name="expression">	Any boolean expression that when evaluated if true, the LED pattern is chamged. </param>
/// <param name="Index">	 	Index of LED array (each up to 32 bits). </param>
/// <param name="dwPattern"> 	Specifies the bit pattern. </param>
///-------------------------------------------------------------------------------------------------

CEDebugCF_API void  DebugLED( BOOL expression, WORD Index, DWORD dwPattern)
{
	DEBUGLED(expression, (Index,dwPattern));
}

///-------------------------------------------------------------------------------------------------
/// <summary>	Calls the debug message macro RETAILMSG with a formatted string that includes the given line number and the message </summary>
///
/// <remarks>	This macro is present in Retail, Debug and Checked builds; it does nothing in Ship builds </remarks>
/// <summary>	See C:\WINCE800\public\common\oak\drivers\nleddrvr</summary>
/// <summary>	Note NLEDs has been removed from the Catalog in WEC 2013 </summary>
///
/// <param name="expression">	Any boolean expression that when evaluated if true, the line number and formatted message appears in Output-Debug on dev system </param>
/// <param name="message">   	The formatted message. </param>
/// <param name="lineNo">   	The code line number. Needs to be manually entered. </param>
///-------------------------------------------------------------------------------------------------

CEDebugCF_API void  Trace( BOOL expression, LPWSTR message, int LineNo)
{
	RETAILMSG(expression, (_T("LineNo:%5d %s"),LineNo,message));
}




